home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C
/
Applications
/
Python 1.3.3
/
stdwin
/
Tools
/
monocase.c
< prev
next >
Wrap
Text File
|
1995-12-21
|
451b
|
30 lines
/* monocasecmp -- like strcmp but upper and lower case letters
are considered identical. */
#include <ctype.h>
#define EOS '\0'
int
monocasecmp(a, b)
register char *a;
register char *b;
{
for (;;) {
register char ca= *a++;
register char cb= *b++;
if (ca == cb) {
if (ca == EOS)
return 0;
}
else {
if (islower(ca))
ca= toupper(ca);
if (islower(cb))
cb= toupper(cb);
if (ca != cb)
return ca - cb;
}
}
}